package sys_enum

// 系统-策略类型
type sysPermissionPolicyType int

var SysPermissionPolicyType sysPermissionPolicyType

// 菜单
func (c *sysPermissionPolicyType) Menu() int {
	return 1
}

// 按钮
func (c *sysPermissionPolicyType) Button() int {
	return 2
}

// 列表项
func (c *sysPermissionPolicyType) ListItem() int {
	return 3
}

// 搜索过滤项
func (c *sysPermissionPolicyType) FilterItem() int {
	return 4
}

func (c *sysPermissionPolicyType) ToText(value int) string {
	switch value {

	case 1:
		return "菜单"

	case 2:
		return "按钮"

	case 3:
		return "列表项"

	case 4:
		return "搜索过滤项"

	}
	return ""
}

func (c *sysPermissionPolicyType) ToValue(text string) int {
	switch text {

	case "菜单":
		return 1

	case "按钮":
		return 2

	case "列表项":
		return 3

	case "搜索过滤项":
		return 4

	}
	return 0
}
